﻿using MiniExcelLibs.Attributes;
using Newtonsoft.Json;
using SqlSugar;

namespace WYD.Model
{
    public class SysBase
    {
        /// <summary>
        /// 创建人
        /// </summary>
        [SugarColumn(IsOnlyIgnoreUpdate = true, Length = 64, IsNullable = true, ColumnName = "Create_by")]
        [ExcelIgnore]
        public long CreateBy { get; set; }
        
        [SugarColumn(IsOnlyIgnoreUpdate = true, ColumnName = "Create_name")]
        [ExcelIgnore]
        public string? CreateName { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        [SugarColumn(IsOnlyIgnoreUpdate = true, IsNullable = true, InsertServerTime = true, ColumnName = "Create_time")]
        [ExcelColumn(Format = "yyyy-MM-dd HH:mm:ss")]
        public DateTime CreateTime { get; set; } = DateTime.Now;

        /// <summary>
        /// 更新人
        /// </summary>
        [JsonIgnore]
        [SugarColumn(IsOnlyIgnoreInsert = true, Length = 64, IsNullable = true, ColumnName = "Update_by")]
        [ExcelIgnore]
        public long UpdateBy { get; set; }
        
        [JsonIgnore]
        [SugarColumn(IsOnlyIgnoreInsert = true, ColumnName = "Update_name")]
        [ExcelIgnore]
        public string? UpdateName { get; set; }

        /// <summary>
        /// 更新时间
        /// </summary>
        //[JsonIgnore]
        [SugarColumn(IsOnlyIgnoreInsert = true, IsNullable = true, UpdateServerTime = true, ColumnName = "Update_time")]
        [ExcelIgnore]
        public DateTime? UpdateTime { get; set; }
        [SugarColumn(Length = 500)]
        public string? Remark { get; set; }
    }
}
